<extend name="Base/common"/>

<block name="style">
<link href="__CSS__/stylesheet.css" rel="stylesheet">
<link href="__CSS__/pzg_stylesheet.css" rel="stylesheet">
</block>

<block name="script">
<script type="text/javascript" src="__JS__/banner.js"></script>
<script type="text/javascript">
$(function(){
	$('nav .tools li').eq(0).remove();
	
	$('.sub-menu').hover(function(){
		$(this).find('ul').removeClass('hidden');
	}, function(){
		$(this).find('ul').addClass('hidden');
	});
});
</script>
</block>

<block name="header">
<header>
	<div class="container">
		<section class="menu-top">
			<div class="fl">
				<section class="header-logo-search">
					<div class="logo fl">
						<img src="__IMG__/logo.png"/>
					</div>
					<div class="search form-group fl">
						<form action="" method="post" autocomplete="off">
							<div class="dropdown fl">
								<a data-toggle="dropdown" href="javascript:;">商品</a>
								<ul class="dropdown-menu">
									<li><a href="javascript:;" data-id="putong">商品</a></li>
									<li><a href="javascript:;" data-id="paipin">拍品</a></li>
									<li><a href="javascript:;" data-id="xianzhi">闲置</a></li>
								</ul>
							</div>
							<input name="type" type="hidden" value="putong">
							<input name="title" type="text" class="search-text" />
							<a href="javascript:;" class="search-btn fr">搜 索</a>
							<script type="text/javascript">
							$(function(){
								$('.dropdown li a').click(function(){
									self = $(this), type = $('.search input[name="type"]');
									$('.dropdown > a').text(self.text());
									type.val(self.attr('data-id'));
								});
							});
							</script>
						</form>
					</div>
				</section>
				<section class="header-ad">
					<img src="__IMG__/header_ad.png">
				</section>
			</div>
	        <div class="fr qrecode">
	            <img src="__IMG__/QRcode.png"/>
	        </div>
        </section>
        <div class="sub-menu fl">
			<a class="sub-menu-top" href="{:U(Product/index)}">全部商品分类</a>
			<ul class="hidden">
				<volist name=":getCategoryTree()" id='vo'>
				<li>
					<a  class="title" href="{:U('Goods/goodslist?cid='.$vo['id'])}">{$vo.title}</a>
					<div class="sub-menu-list">
						<volist name="vo._child" id="child">
							 <a href="{:U('Goods/goodslist?cid='.$child['id'])}">{$child.title}</a>
					  </volist>
					</div>
				</li>
				</volist>
			</ul>
		</div>
		<div class="sub-nav">
	       	<ul>
	       		<li><a href="{:U('Index/index')}">首页</a></li>
	       		<li><a href="{:U('Jzb/index')}">鉴真宝</a></li>
	       		<li><a href="{:U('Pzb/index')}">拍真宝</a></li>
	       		<li><a href="{:U('Qgh/index')}">抢购会</a></li>
	       		<li><a href="{:U('Pzg/index')}">拍照购</a></li>
	       		<li><a href="{:U('Xlw/index')}">选礼物</a></li>
	       		<li><a href="{:U('Xz/index')}">闲置</a></li>
	       	</ul>
	    </div>
	</div>
</header>
</block>

<block name="body">
<div class="container main">
	<div class="col-xs-9 list" style="background-color: #ffffff;">
		<div class="row">
			<ul class="breadcrumb" style="background-color: #f5f5f5;">
				<li>当前位置</li>
				<li><a href="#">首页</a></li>
				<li>拍照购</li>
			</ul>
			<div class="projects-header page-header">
				<h2>拍照购</h2>
				<p>请上传您的需求，需求直达商家，更多报价不买贵！</p>
			</div>
			<form action="{:U('Pzg/pzgSave')}" method="post" class="form-horizontal" enctype="multipart/form-data">
				<div class="form-group">
					<label class="col-xs-2 control-label">商品标题：</label>
					<div class="col-xs-8">
						<input type="text" name="title" value="" placeholder="商品名称" class="form-control">
					</div>
				</div>
				<div class="form-group">
					<label class="col-xs-2 control-label">商品分类：</label>
					<div class="col-xs-8">
						<select name="category_id" class="form-control">
							<option value="">请选择分类</option>
							<volist name="category_tree" id="cate">
			     				<optgroup label="{$cate.title}">
			     					<volist name="cate._child" id="_child">
			     						<option value="{$_child.id}" <eq name="info.category_id" value="$_child.id">selected</eq>>{$_child.title}</option>
			     					</volist>
			     				</optgroup>
			     			</volist>
						</select>
					</div>
				</div>
				<div class="form-group">
					<label class="col-xs-2 control-label">价格区间：</label>
					<div class="col-xs-3">
						<div class="input-group">
							<input type="text" name="price_start" value="" placeholder="最低价格" class="form-control">
							<div class="input-group-addon">元</div>
						</div>
					</div>
					<div class="col-xs-1"><hr></div>
					<div class="col-xs-3">
						<div class="input-group">
							<input type="text" name="price_end" value="" placeholder="最高价格" class="form-control">
							<div class="input-group-addon">元</div>
						</div>
					</div>
				</div>
				<div class="form-group">
					<label class="col-xs-2 control-label">商品描述：</label>
					<div class="col-xs-8">
						<textarea rows="6" class="form-control" name="description"></textarea>
					</div>
				</div>
				<div class="form-group">
					<label class="col-xs-2 control-label">商品图片或视频：</label>
					<div class="col-xs-10 row">
						<div class="col-xs-2">
							<input  id="file_img" accept="image/*" name="file_img" style="display: none;">						
						</div>
						<div class="col-xs-2">
							<input type="file" id="file_video" name="file_video" accept="video/*" style="display: none;">
							
						</div>
						<div class="col-xs-10 files">							
							<p class="file-info">文件名称：<span class="file-name">jzb2.flv</span>
							<input type='hidden' name='pzg_movie_file[]' value='12' />
							<a class="fr" href="javascript:;"><i class="icon-remove icon-large" ></i></a></p>
						</div>
					</div>
				</div>
				<!--  -->				
					<script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>					
					<script type="text/javascript">
					//上传图片
				    /* 初始化上传插件 */
					$("#file_img").uploadify({
				        "height"          : 30,
				        "swf"             : "__STATIC__/uploadify/uploadify.swf",
				        "fileObjName"     : "download",
				        "buttonText"      : "上传图片",
				        "uploader"        : "{:U('File/uploadPicture',array('session_id'=>session_id()))}",
				        "width"           : 120,
				        'removeTimeout'	  : 1,
				        'fileTypeExts'	  : '*.jpg; *.png; *.gif;',
				        "onUploadSuccess" : uploadPicture_panel,
				        'onFallback' : function() {
				            alert('未检测到兼容版本的Flash.');
				        }
				    });
					function uploadPicture_panel(file, data){
				    	var data = $.parseJSON(data);							    	
				        if(data.status){
				        	$(".files").append(
		        			"<p class='file-info'>文件名称：<span class='file-name'>"
		        			+file.name
		        			+"</span>"
		        			+"<input type='hidden' name='pzg_image_file[]' value='"+data.id+"' />"
		        			+"<a class='fr' href='javascript:;'><i class='icon-remove icon-large' ></i></a></p>"
				        	);
				        } else {
				        	updateAlert(data.info);
				        	setTimeout(function(){
				                $('#top-alert').find('button').click();
				                $(that).removeClass('disabled').prop('disabled',false);
				            },1500);
				        }
				    }
	
			    /* 初始化上传插件 */
				$("#file_video").uploadify({
			        "height"          : 30,
			        "swf"             : "__STATIC__/uploadify/uploadify.swf",
			        "fileObjName"     : "download",
			        "buttonText"      : "上传视频文件",
			        "uploader"        : "{:U('File/uploadMovie',array('session_id'=>session_id()))}",
			        "width"           : 120,
			        'removeTimeout'	  : 1,
			        'multi'			  : false,
			        'fileTypeExts'	  : '*.flv; *.avi; *.wma; *.rmvb; *.rm; *.flash; *.mp4; *.mid; *.3gp;',
			        "onUploadSuccess" : uploadMovie,
			        'onFallback' : function() {
			            alert('未检测到兼容版本的Flash.');
			        }
			    });
			
				function uploadMovie(file, data){
			    	var data = $.parseJSON(data);
			        if(data.status){
			        	$(".files").append(
			        			"<p class='file-info'>文件名称：<span class='file-name'>"
			        			+file.name
			        			+"</span>"
			        			+"<input type='hidden' name='pzg_movie_file[]' value="+data.info.id+" />"
			        			+"<a class='fr' href='javascript:;'><i class='icon-remove icon-large'></i></a></p>"
			        	);
			        	
			        } else {
			        	alert(data.info);
			        	setTimeout(function(){
			                $('#top-alert').find('button').click();
			                $(that).removeClass('disabled').prop('disabled',false);
			            },1500);
			        }
			    }	
				
				$("div").delegate(".icon-remove","click",function(){
					$(this).closest('p').remove();			
				});
				
				</script>	
				<!-- -->
				<div class="form-group">
					<label class="col-xs-2 control-label">服务保障：</label>
					<div class="col-xs-8">
						<label class="checkbox-inline"><input type="checkbox" value="1" name="security_7days">支持7天无理由退货</label>
					</div>
				</div>
				<div class="form-group">
					<label class="col-xs-2 control-label">承诺发货时间：</label>
					<div class="col-xs-8">
						<volist name=":getStatus('security_delivery')" id="val" key="key">				    				
		    				<label class="radio-inline"><input type="radio" name="security_delivery" value="{$key-1}">{$val}</label>					
		    			</volist>
					</div>
				</div>
			
				<div class="form-group center">
					<label class="col-xs-2 control-label"></label>
					<div class="col-xs-8">
						<a class="btn submitbtn ajax-post" href="javascript:;" target-form="form-horizontal">发 布</a>
					</div>
				</div>
			</form>
		</div>
	</div>
	<div class="col-xs-3 hot">
		<h5>热门商品</h5>
		<div class="form-group auto-overflow">
			<a href="#"><img src="__IMG__/qgh/img4.gif" /></a>
			<div class="fl info">
				<div class="title"><a href="#">翡翠专卖场翡翠专卖场翡翠专卖场翡翠专卖场翡翠专卖场</a></div>
				<div class="desc">
					<span class="price">￥250.00</span>
					<span class="sale fr">销量：2555</span>
				</div>
			</div>
		</div>		
	</div>
</div>
</block>